package tako.wisers.com.android.apis.listener;

import tako.wisers.com.android.apis.event.Event;
import tako.wisers.com.android.apis.event.EventBus;
import tako.wisers.com.android.apis.event.KeyDownEvent;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnKeyListener;

public class KeyListener implements OnKeyListener {

	@Override
	public boolean onKey(View v, int keyCode, KeyEvent event) {
		if(keyCode == KeyEvent.KEYCODE_ENTER){
			EventBus.getInstance().executeEvent(new KeyDownEvent(v.getId(), Event.EVENT_KEY_DOWN, keyCode));
			return true;
		}
		return false;
	}

}
